import Vue from 'vue'
import Router from 'vue-router'


import Login from '@/views/login'
import Home from '@/views/home'
import Home1 from '@/views/home1'
import Rules from '@/views/rules'



//个人中心
import Personalinfo from '@/views/usercenter/personalinfo'
import Message from '@/views/usercenter/message'
import Changepassword from '@/views/usercenter/message'
import MyAttendance from '@/views/administration/myattendance'
import MyPaySlip from '@/views/administration/mypayslip'
// 审批流程
import MyApply from '@/views/processapproval/myApply'


import Apply from '@/views/processapproval/apply'
import CardApply from '@/views/processapproval/cardapply'
import ProcessSetLeave from '@/views/processapproval/ProcessSetLeave'

import ProcessApply from '@/views/processapproval/processApply'
import ForMyApproval from '@/views/processapproval/forMyApproval'
import ApprovedByMe from '@/views/processapproval/approvedByMe'
import ReadForMe from '@/views/processapproval/readForMe'
import ProcessSet from '@/views/processapproval/ProcessSet'
import ProcessSearch from '@/views/processData/processSearch'
import ApplyEfficiency from '@/views/processData/applyEffciency'
import OvertimeCensus from '@/views/processData/OvertimeCensus'
//内部邮件
import Newmail from '@/views/insideMail/newmail'
import MyMail from '@/views/insideMail/mymail'
import MailSettings from '@/views/insideMail/mailsettings'
//外部邮件
import newmail from '@/views/outsideMail/newmail'
import myMail from '@/views/outsideMail/mymail'
import mailSettings from '@/views/outsideMail/mailsettings'
//企业设置
import Businessinfo from '@/views/businessSet/businessinfo'
import Organization from '@/views/businessSet/organization'
import PostManage from '@/views/businessSet/postManage'
import StaffManage  from '@/views/businessSet/staffManage'
import RoleManage from '@/views/businessSet/roleManage'
import AttendanceSet  from '@/views/businessSet/attendanceSet'
//系统设置
import ModularManage  from '@/views/systemManage/modularManage'
import SystemSafe  from '@/views/systemManage/systemSafe'
import LoginLog from '@/views/systemManage/loginLog'
import OperationLog  from '@/views/systemManage/operationLog'




Vue.use(Router)


const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    children: [
        { path: 'home', component: Home },
        { path: 'home1', component: Home1 },
        { path: 'rules', component: Rules },

       { path: 'personalinfo', name: Personalinfo, component: Personalinfo ,
          children: [
          {path: 'message', name: Message, component: Message },
          {path: 'changepassword',name: Changepassword, component: Changepassword },
          {path: 'myattendance', name: MyAttendance, component: MyAttendance },
          {path: 'mypayslip', name: MyPaySlip, component: MyPaySlip }
      
          ]},
      { path: 'myApply', name: MyApply, component: MyApply ,
       children: [ {path: 'processapply', name: ProcessApply, component: ProcessApply },

       {path: 'processsetleave', name: ProcessSetLeave, component: ProcessSetLeave },
       {path: 'apply', name: 'Apply', component: Apply },
       {path: 'cardapply', name: 'CardApply', component: CardApply },

       {path: 'formyapproval', name: ForMyApproval, component: ForMyApproval },
       {path: 'approvedbyme', name: ApprovedByMe, component: ApprovedByMe },
       {path: 'readforme', name: ReadForMe, component: ReadForMe },
       {path: 'processset', name: ProcessSet, component: ProcessSet },
       {path: 'processsearch', name: ProcessSearch, component: ProcessSearch },
       {path: 'applyefficiency', name: ApplyEfficiency, component: ApplyEfficiency },
       {path: 'overtimecensus', name: OvertimeCensus, component: OvertimeCensus }
       ]},
       { path: 'newmail', name: Newmail, component: Newmail ,
       children: [
       
        {path: 'mymail', name: MyMail, component: MyMail },
        {path: 'mailsettings', name: MailSettings, component: MailSettings }
      
       ]},,{ path: 'newmail', name: newmail, component: newmail ,
       children: [
       
        {path: 'mymail', name: myMail, component: myMail },
        {path: 'mailsettings', name: mailSettings, component: mailSettings }
      
       ]},{ path: 'businessinfo', name: Businessinfo, component: Businessinfo,
       children: [
       
        {path: 'organization', name: Organization, component: Organization },
        {path: 'postmange', name: PostManage, component: PostManage },
        {path: 'staffmanage', name: StaffManage, component: StaffManage },
        {path: 'rolemanage', name: RoleManage, component: RoleManage },
        {path: 'attendanceset', name: AttendanceSet, component: AttendanceSet },
        {path: 'modularmanage', name: ModularManage, component: ModularManage },
        {path: 'systemsafe', name: SystemSafe, component: SystemSafe },
        {path: 'loginlog', name: LoginLog, component: LoginLog },
        {path: 'operationlog', name: OperationLog, component: OperationLog }
      
       ]}
    ]
  },

  {
    path: '/rules',
    name: 'Rules',
    component: Rules
  }
]

const router = new Router({
  mode: 'history',
  routes
})

// //router 全局前置守卫
// router.beforeEach((to, from, next) => {
//   // to and from are both route objects. must call `next`.
//   console.info(to.path);
// });

export default router
